package com.toune.villager.adapter

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.toune.villager.R
import com.toune.villager.bean.BaiduHotTopicBean
import kotlinx.android.synthetic.main.adapter_community.view.*

class CommunityAdapter(layoutResId: Int, data: MutableList<BaiduHotTopicBean>?) :
    BaseQuickAdapter<BaiduHotTopicBean, BaseViewHolder>(layoutResId, data) {
    override fun convert(holder: BaseViewHolder, item: BaiduHotTopicBean) {
        Glide.with(context).load(item.src).into(holder.getView(R.id.leftIv))
        holder.setText(R.id.topicTv,item.title)
        holder.setText(R.id.contentTv,item.sub)
    }
}